
package com.kugou.game.sdk.utils;

import com.kugou.framework.preference.PreferenceOpenHelper;
import com.kugou.game.sdk.core.SDKControler;

import android.content.Context;

/**
 * 描述:本地信息存储类
 * 
 * @author liux
 * @since 2014-3-26 下午05:48:34
 */
public class SettingPref extends PreferenceOpenHelper {

    private static SettingPref mSettingPref;

    public SettingPref(Context context, String prefname) {
        super(context, prefname);
    }

    public synchronized static SettingPref getInstance() {
        if (mSettingPref == null) {
            Context context = SDKControler.getContext();
            String name = "kysdk_setting";
            mSettingPref = new SettingPref(context, name);
        }
        return mSettingPref;
    }

    /**
     * 获取当天请求验证码剩余次数
     * 
     * @return
     */
    public int getRemainValidateTimes() {
        return getInt(AppUtil.getTodayDate(), 6);
    }

    public void putRemainValidateTimes(int times) {
        putInt(AppUtil.getTodayDate(), times);
    }
}
